<%@ page language="java" contentType="text/html; charset=US-ASCII"
	pageEncoding="US-ASCII"%>
<%@ page import="java.util.*"%>
<%@ page import="fr.esgi.classes.Promotion"%>
<%@ page import="fr.esgi.donnees.Database"%>
<%ArrayList <Promotion> listPromotion;
ArrayList <Projet> listProjet;
ArrayList <String> listPromo;
 Database d=new Database();
listPromo=d.afficherPromo();
listPromotion=d.afficherPromotion();
listProjet=d.afficherProjet();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <title>Web site</title>
     <%@ include file="../design/header.jsp" %> 
    <%--         <%@ include file="../design/menu.jsp" %>  --%>
          </div>  
          <div class="bd"> 
            <div id="page"> 
           
              <!-- MAIN COLUMN -->  
              <div id="main"> 
                <div class="content"> 
                  <h1>Bienvenue !</h1>  
	<form name="form" action="ValidationInscription" method="post">
	
	<%
						String erreur = (String) request.getAttribute("erreur");
						// Affichage du message s'il existe
						if (erreur != null) {
							out.println("<strong>Erreur :" + erreur + " </strong>");

						}
					%>
		<p>
			prenom : <input name="firstname" />
		</p>
		<p>
			nom : <input name="lastname" />
		</p>
		<p>
			email : <input name="mail" />
		</p>
		<p>
			mot de passe : <input type="password" name="mdp" />
		</p>
		<p>
						Promotion<select id="promotion" name="promotion"
							onchange="griser();">
							<%
								for (int i = 0; i < listPromo.size(); i++) {
							%>
							<option
								value="<%out.print(listPromo.get(i));%>">
								<%
									out.println(listPromo.get(i));
								%>
							</option>
							<%
								}
							%>
						
						</select>  Groupe <select name="groupe" id="groupe">
						<%
								for (int i = 0; i < listPromotion.size(); i++) {
								if(listPromotion.get(0).getAnneeSpecialite().equals(listPromotion.get(i).getAnneeSpecialite())){
						%>
							<option value="<%out.print(listPromotion.get(i).getGroupe());%>">
								<%
									out.println(listPromotion.get(i).getGroupe());
								%>
							</option>
							<%
								}
							}
							%>
						</select>
					</p>
		<input type="submit" name="valider">
	</form>
</body>
<%@ include file="../design/footer.jsp" %>